SET("COPY_TO_BUILD_DIR_Debug" "@COPY_TO_BUILD_DIR_Debug@")
SET("COPY_TO_BUILD_DIR_Release" "@COPY_TO_BUILD_DIR_Release@")
SET("COPY_TO_BUILD_DIR_MinSizeRel" "@COPY_TO_BUILD_DIR_MinSizeRel@")
SET("COPY_TO_BUILD_DIR_RelWithDebInfo" "@COPY_TO_BUILD_DIR_RelWithDebInfo@")

FOREACH(src_file ${COPY_TO_BUILD_DIR_${CFG}})
	SET(subdir "")
	IF(src_file MATCHES ".*=>.*")
		STRING(REGEX REPLACE ".*=>(.*)" "/\\1" subdir "${src_file}")
		STRING(REGEX REPLACE "(.*)=>.*" "\\1" src_file "${src_file}")
	ENDIF()
	SET(dst_dir "${TARGET_DIR}${subdir}")
	
	GET_FILENAME_COMPONENT(dst_file "${src_file}" NAME)
	
	IF("${src_file}" IS_NEWER_THAN "${dst_dir}/${dst_file}")
		MESSAGE(STATUS "Copying ${dst_file} to ${CFG}${subdir}")
		CONFIGURE_FILE("${src_file}" "${dst_dir}/${dst_file}" COPYONLY)
	ENDIF()
ENDFOREACH()